import http from '@http/http'
export const _getUserInfo = (errMsg) => http.GET('/api/auth/userInfo', {}, errMsg)
// 登录 本质还是发送了一个get请求，只是封装了一遍
// export const login = function (obj) {
//   http.GET('/api/admin/login', obj)
// }
export const userLogin = obj => http.GET('/api/admin/login', obj)

export const userLogin1 = obj => http.POST('/api/whitelistSetting/login', obj)

export const userLogin2 = obj => http.POST('/api/user/login', obj)

// 登出 不需要返回就不写参数喽
export const userLogout = () => http.GET('/api/whitelistSetting/logout')
// 分页查询用户
export const userList = (obj) => http.GET('/api/whitelistSetting/pageList', obj)
export const systemManageList = (obj) => http.GET('/api/user/pageList', obj)

// 删除用户
export const removeUser = id => http.GET('/api/whitelistSetting/removeById?id=' + id)

export const removeUsers = obj => http.POST('/api/whitelistSetting/removeByIds', obj)

export const editUser = obj => http.POST('/api/whitelistSetting/edit', obj)

export const editSystemManage = obj => http.POST('/api/user/edit', obj)
export const exportUser = () => http.EXPORT('/api/whitelistSetting/exportUser')

export const importUser = (obj) => http.POST('/api/whitelistSetting/importUser', obj)
// Lists for yq
export const yqList = (obj) => http.GET('/api/yq/yqList', obj)
export const bedNumberList = (obj) => http.GET('/api/bed/getBedById', obj)
export const roomNumberList = (obj) => http.GET('api/rooms/getRoomById', obj)
export const buildingNumberList = (obj) => http.GET('/api/buildings/getBuildingById', obj)

export const insertYq = (obj) => http.GET('/api/yq/insertYq', obj)
// Lists for buildings
export const buildingList = (obj) => http.GET('/api/buildings/buildingList', obj)
export const room4BuildingsList = (obj) => http.GET('/api/rooms/getRoomByBuilding', obj)
export const bed4BuildingsList = (obj) => http.GET('/api/bed/getBedByBuilding', obj)
export const insertBuildings = (obj) => http.GET('/api/buildings/insert', obj)
export const buildingListByIdYq = (obj) => http.GET('/api/buildings/buildingListPlus', obj)
// List for rooms
export const insertRooms = (obj) => http.GET('/api/rooms/insert', obj)

export const insertRoomsPlus = obj => http.POST('/api/rooms/insertPlus', obj)
export const roomList = (obj) => http.GET('/api/rooms/getRoomList', obj)
export const editbedManage = obj => http.POST('/api/rooms/edit', obj)
// List for bed
export const bedList = (obj) => http.GET('/api/bed/getBedList', obj)

// 柱状图数据获取
export const barChartData = () => http.GET('/api/student/barChartData')

export const pieChartData = () => http.GET('/api/student/pieChartData')

export const spareBed = () => http.GET('/api/bed/spareBed')

export const degreeStudentData = () => http.GET('/api/student/degreeStudentData')

export const bksBedData = () => http.GET('/api/student/bksBedData')

export const yjsBedData = () => http.GET('/api/student/yjsBedData')

export const otherBedData = () => http.GET('/api/student/otherBedData')

export const getUnusedBedList = (obj) => http.GET('/api/bed/getUnusedBedList', obj)

export const findStudent = obj => http.GET('/api/student/findStudent', obj)

export const bedAllocation = obj => http.POST('/api/student/bedAllocation', obj)

export const editBuilding = obj => http.POST('/api/buildings/editBuilding', obj)

export const countRoomsNumber = obj => http.GET('/api/rooms/countNumber', obj)
